//
//  SUNDemoController.swift
//  SUNweibo
//
//  Created by sighting on 16/8/21.
//  Copyright © 2016年 sighting. All rights reserved.
//

import UIKit

class SUNDemoController: SUNBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        guard let count = navigationController?.childViewControllers.count
            else { return  }
        navItem.title = "第\(count)个"
    }

    // rightBarButtonItem 点击事件
    @objc private func pushNew(){
    
        let vc = SUNDemoController()
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension SUNDemoController{

    // 重写父类setUI
    override func setUI() {
        super.setUI()
        
    // MARK:navigationItem右侧按钮设置
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(pushNew), isBack: false)
    }
    
}

